1. Field of the Invention
This invention relates to the storage of pixel information in a memory means.
2. Background Art
Computer graphics and imaging systems often use color displays as output devices, or as a means to view work in progress before generating a color print output. Color graphics and images are stored in a computer memory system as an array of picture elements (pixels). Each pixel contains information representing red (R), green (G), blue (B) and opacity, or "alpha" (A) information. The R, G and B components of a pixel determine the relative amounts and intensities of the red, green and blue components of the display pixel. By varying the amounts of these primary colors, different colored output pixels are defined. The alpha component defines the opacity of the pixel, and is used primarily when assembling images; it does not normally affect the display of assembled pixels.
An example of a system for displaying RGBA color is illustrated in FIG. 1. A refresh buffer 14, also known as a video RAM, or VRAM, is used to store color information for each pixel to be displayed on a video display, such as CRT display 18. A dynamic random access memory (DRAM) can also be used as buffer 14. The VRAM 14 contains one memory location for each pixel location on the display 18. For example, pixel 20 at screen location X.sub.m Y.sub.n corresponds to memory location 21 in the VRAM 14. The number of bits stored at each memory location for each display pixel varies depending on the amount of color resolution required. For example, for word processing applications or display of text, images having two intensity levels are acceptable so that only a single bit need be stored at each memory location (the screen pixel is either "on" or "off"). For color images, however, a plurality of intensities must be definable. For certain high-end color graphics applications, it has been found that 32 bits per pixel (eight bits each of R, G, B and A components) produce acceptable images.
Consider, for example, that in the system of FIG. 2, an image is stored in memory and 32 bits are stored for each image pixel. Each pixel of the image is represented by 8 bits each for the red, green, blue and alpha components of the pixel. A display image is assembled from this stored information, and the alpha component is used to determine the visibility of pixels included in the assembled image. Thereafter, the R, G and B components of the display pixel are provided to VRAM 14.
At memory location 21, there are eight bits each for the red, green and blue components of the display pixel. The eight most significant bits of the VRAM memory location are used to represent the red component, the next eight bits represent the green component, and the eight least significant bits represent the blue value. This permits 256 shades each of red, green and blue to be defined.
The bits corresponding to the R, G and B components are provided to the R, G and B D/A converters 17, respectively. The red, green and blue signals drive the red, green and blue phosphors at a pixel location 20 on the display. By varying the intensities of the red, green and blue components, different colors may be produced at that pixel location.
The resolution of the image of the display is dependent on the number of brightness or color levels that each pixel can represent. The greater the number of bits that represent each pixel, the greater the number of brightness levels (and correspondingly, shades of color) that can be defined. In the system described herein, with eight bits each of red, green and blue components per pixel, over 16 million possible colors can be displayed.
A disadvantage of high resolution color display systems is the large pixel storage requirement. It is often desired to reduce the number of bits representing each pixel so storage requirements can be reduced. However, a reduction in the number of bits defining a pixel results in a reduction in the pixel bit resolution, hence a desire to reduce pixel size in a manner such that the lost bit resolution in another form.
The bit resolution of a pixel is important in the resolution and clarity of the image produced on a display. Display images are comprised of a plurality of pixels that, when viewed together, combine to form an image.
One prior art compression scheme is implemented in Adobe's PostScript software. A general method is provided for compressing N bits to M bits, known as "ordered dither." An example is given here for the case of an 8-bit source pixel compressed to a 4-bit target pixel.
The 8-bit source pixel components have a range of 0 to 255, representing a linear intensity from black to white, respectively. The 4-bit target pixel components have a range of 0 to 15 to represent the same intensity range. The ratio of maximum source to target intensities is 255/15=17 (such integer relationships hold for ratios of (2.sup.n -1)/(2.sup.m -1) when m is a factor of n. Thus, dithering 12-bit components to 3-bit components or 10-bit to 5-bit result in an integer ratio; dithering 10-bit to 3-bit does not).
Thus, each step in target intensity represents 17 steps of source intensity:
______________________________________ Target Source ______________________________________ 0 0 .fwdarw. 16 1 17 .fwdarw. 33 2 34 .fwdarw. 50 3 51 .fwdarw. 67 4 68 .fwdarw. 84 5 85 .fwdarw. 101 6 102 .fwdarw. 118 7 119 .fwdarw. 135 8 136 .fwdarw. 152 9 153 .fwdarw. 169 10 170 .fwdarw. 186 11 187 .fwdarw. 203 12 204 .fwdarw. 220 13 221 .fwdarw. 237 14 238 .fwdarw. 254 15 255 ______________________________________
To convert an n-bit source to m-bit target, two values are calculated, BASE and DELTA. BASE is the integer part of source/17. DELTA is 15 (source modulo 17). BASE is in the range 0-15; DELTA is in the range 0-255 (the range 0-255 is chosen to be the generic threshold matrix depth for PostScript; the scale by 15 would be unnecessary if the threshold matrix depth was 17).
A threshold matrix of dimensions WIDTH by HEIGHT is addressed by (X+X.phi.) modulo-WIDTH, and (Y+Y.phi.) modulo-HEIGHT, where (X,Y) are the coordinates of the source pixel in an image, and (X.phi.,Y.phi.) is a phase adjustment between the image and some reference (such as the origin of the raster display in which the image is located). Typically the threshold matrix contains an even distribution of values. The criteria determining WIDTH, HEIGHT and spatial distribution within the array are outside the scope of this discussion.
The addressed value from the threshold matrix determines the final target value. If DELTA is less than the addressed threshold value, the final target is (base). If DELTA is greater than or equal to the addressed threshold value, the final target is (base+1). Assuming a sufficiently large matrix and an even distribution of values, the ratio of (base) to (base+1) target values resulting from a given source value will be delta/256. The detail lost in bit resolution is thus regained as noise distributed spatially.